package com.sky.controller.employee;

import com.sky.dto.MeetingRoomStatusPageQueryDTO;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.MeetingRoomStatusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Builder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/employee/meetingRoomStatusShow")
@Slf4j
@CrossOrigin
@Builder
@Api(tags = "会议室状态查看")
public class MeetingRoomStatusController {
    @Autowired
    private MeetingRoomStatusService meetingRoomStatusService;

    // 会议室状态查看
    @ApiOperation(value="分页查询会议室状态信息(根据名字、日期与状态(预定、锁定、空闲、维护、使用)查询)")
    @GetMapping("/page")
    public Result<PageResult> page(MeetingRoomStatusPageQueryDTO meetingRoomStatusPageQueryDTO){
        log.info("分页查询: {}", meetingRoomStatusPageQueryDTO); //框架会自动将数据封装到实体类对象中，即使有一些为空
        PageResult pageResult = meetingRoomStatusService.pageQuery(meetingRoomStatusPageQueryDTO);
        return Result.success(pageResult);
    }

}
